# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=libnftnl
pkgver=1.2.6
pkgrel=0
pkgdesc="Netfilter library providing interface to the nf_tables subsystem"
url="https://netfilter.org/projects/libnftnl"
arch="all"
license="GPL-2.0-or-later"
makedepends="bash jansson-dev libmnl-dev"
provides="$pkgname-libs=$pkgver-r$pkgrel"  # for backward compatibility (Alpine <3.15)
replaces="$pkgname-libs"  # for backward compatibility (Alpine <3.15)
subpackages="$pkgname-dev"
source="https://netfilter.org/projects/libnftnl/files/libnftnl-$pkgver.tar.xz"

case "$CARCH" in
	s390x) options="!check" ;; # FIXME
esac

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-static
	make
}

check() {
	cd tests
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
0c8c369eec84b0c568f0067598bece6e3be9a0fbd977e443ae3b14a5a6d842a6086ceb5426a65f8c77204709655f148c1241193f1a928f8c12154a57e3548b34  libnftnl-1.2.6.tar.xz
"
